package com.example.demo.mapper;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.demo.entity.Topic;
import java.util.List;
import org.apache.ibatis.annotations.Param;

/**
 * 动态 Mapper 接口
 *
 * @author 俊何
 * @since 2021-08-09
 */
@DS("slave")
public interface TopicMapper extends BaseMapper<Topic> {
  /**
   * 动态list
   *
   * @param userId
   * @return
   */
  List<Topic> findAllByUserIdOrderBySort(@Param("userId") Integer userId);

  List<Topic> getById(@Param("id") Long id);
}
